import { create } from 'zustand'
import { devtools, subscribeWithSelector } from 'zustand/middleware'

const initFoodValue = {
  fish: 0
}

export const useFoodStore = create(
  devtools(
    subscribeWithSelector(() => initFoodValue)
    // {
    //   name: 'foodStore',
    //   enabled: false
    // }
  )
)

export const addFish = () =>
  useFoodStore.setState(state => ({ fish: state.fish + 1 }))

export const removeFish = () =>
  useFoodStore.setState(state => ({ fish: state.fish - 1 }))
